<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="zh-CN">
<head>
<!-- 必须的 meta 标签 -->
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap 的 CSS 文件 -->
<link rel="stylesheet" href="/gll/css/bootstrap.min.css" />

<title>Hello, world!</title>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<%@include file="./common/header.jsp"%>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<!--导航栏-->
				<nav class="navbar navbar-expand-lg navbar-dark bg-dark">

					<a class="navbar-brand" href="#">导航</a>
					<button class="navbar-toggler" type="button" data-toggle="collapse"
						data-target="#navbarSupportedContent"
						aria-controls="navbarSupportedContent" aria-expanded="false"
						aria-label="Toggle navigation">
						<span class="navbar-toggler-icon"></span>
					</button>

					<div class="collapse navbar-collapse" id="navbarSupportedContent">
						<ul class="navbar-nav mr-auto">
							<li class="nav-item active"><a class="nav-link"
								href="melist">首页 <span class="sr-only">(current)</span>
							</a></li>

							<li class="nav-item"><a class="nav-link" href="#">订单 <span
									class="sr-only">(current)</span>
							</a></li>

							<li class="nav-item "><a class="nav-link" href="buycars">我的购物车
									<span class="sr-only">(current)</span>
							</a></li>

							<li class="nav-item dropdown"><a
								class="nav-link dropdown-toggle" href="#" id="navbarDropdown"
								role="button" data-toggle="dropdown" aria-haspopup="true"
								aria-expanded="false"> 我的空间 </a>
								<div class="dropdown-menu" aria-labelledby="navbarDropdown">
									<a class="dropdown-item" href="melogin">登陆</a> <a
										class="dropdown-item" href="reg">注册</a> <a class="dropdown-item"
										href="#">地址管理</a> <a class="dropdown-item" href="#">评论区</a> <a
										class="dropdown-item" href="#">统计图</a>
								</div></li>

						</ul>
						<form id="form" action="" method="post"
							class="form-inline my-2 my-lg-0">
							<input type="hidden" name="page" id="page" value="1" /> <input
								class="form-control mr-sm-2" type="search" name="search"
								placeholder="请输入店家名称..." aria-label="Search">
							<button class="btn btn-outline-success my-2 my-sm-0"
								type="submit">搜索</button>
						</form>
					</div>
				</nav>
				<!--END导航栏-->
			</div>
		</div>

		<div class="row">
			<c:forEach var="shop" items="${list}">
				<div class="col-md-4 my-3">
					<!--框-->
					<div class="card" style="width: 22rem;">
						<img src="${initParam.imgs_shop}/${shop.img}" class="card-img-top"
							alt="..." style="height: 300px;">
						<div class="card-body">
							<h5 class="card-title">${shop.name}</h5>
							<div>
								<span class="badge badge-info">收藏</span> <span
									class="ml-4 text-secondary">营业时间：${shop.worktime}
									评分：${shop.score}</span>
							</div>
							<p class="card-text">描述：广州老字号，口碑无数，经营...</p>
						</div>
						<div>
							<a href="cheock?id=${shop.id}">
								<button type="button" class="btn btn-outline-secondary ml-3">
									去看看</button>
							</a>
							<button type="button" class="btn btn-link float-right">投诉</button>
						</div>
						<div class="p-2 bg-light text-secondary mt-4 "
							style="line-height: 45px;">
							<span>商家电话：${shop.tel}</span> <span class="float-right">状态：${shop.workstate == 1 ?"停止营业":"正常营业"}</span>
						</div>
					</div>
					<!--END框-->
				</div>
			</c:forEach>
		</div>

	</div>


	<div class="row ">
		<div class="col-md-12">
			<!--分页-->
			<nav aria-label="Page navigation example">
				<ul class="pagination justify-content-center">
					<c:forEach var="p" begin="1" end="${pageCount}">
						<li class="page-item"><a class="page-link" href="#"
							onclick="getPage(${p});return false;"> ${p} </a></li>
					</c:forEach>
				</ul>
			</nav>
			<!--END分页-->
		</div>
	</div>

	<script>
	function getPage(p) {
		document.getElementById('page').value=p;
		document.getElementById('form').submit();
	}
	
	</script>
	<div class="row">
		<div class="col-md-12 text-center">
			<span>版权所有：咕噜公司|公司简介|联系我们|法律声明</span><br /> <span>地址：广州市海珠区。。。。。。。。。。301</span><br />
			<span>友情提示：网络受骗，加盟需谨慎。（多打电话、多咨询、祥考察，可减低风险）</span>
		</div>
	</div>
	</div>

	<!-- JavaScript 文件是可选的。从以下两种建议中选择一个即可！ -->

	<!-- 选项 1：jQuery 和 Bootstrap 集成包（集成了 Popper） -->
	<script src="/gll/js/jquery-3.2.1.min.js"></script>
	<script src="/gll/js/bootstrap.bundle.min.js"></script>


</body>
</html>